import 'package:oramemo/generated/json/base/json_convert_content.dart';
import 'package:oramemo/entity/user_task_query_entity.dart';

UserTaskQueryEntity $UserTaskQueryEntityFromJson(Map<String, dynamic> json) {
  final UserTaskQueryEntity userTaskQueryEntity = UserTaskQueryEntity();
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    userTaskQueryEntity.total = total;
  }
  final List<UserTaskQueryRows>? rows = (json['rows'] as List<dynamic>?)
      ?.map(
          (e) => jsonConvert.convert<UserTaskQueryRows>(e) as UserTaskQueryRows)
      .toList();
  if (rows != null) {
    userTaskQueryEntity.rows = rows;
  }
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    userTaskQueryEntity.code = code;
  }
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    userTaskQueryEntity.msg = msg;
  }
  return userTaskQueryEntity;
}

Map<String, dynamic> $UserTaskQueryEntityToJson(UserTaskQueryEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total'] = entity.total;
  data['rows'] = entity.rows?.map((v) => v.toJson()).toList();
  data['code'] = entity.code;
  data['msg'] = entity.msg;
  return data;
}

extension UserTaskQueryEntityExtension on UserTaskQueryEntity {
  UserTaskQueryEntity copyWith({
    int? total,
    List<UserTaskQueryRows>? rows,
    int? code,
    String? msg,
  }) {
    return UserTaskQueryEntity()
      ..total = total ?? this.total
      ..rows = rows ?? this.rows
      ..code = code ?? this.code
      ..msg = msg ?? this.msg;
  }
}

UserTaskQueryRows $UserTaskQueryRowsFromJson(Map<String, dynamic> json) {
  final UserTaskQueryRows userTaskQueryRows = UserTaskQueryRows();
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    userTaskQueryRows.createTime = createTime;
  }
  final UserTaskQueryRowsParams? params = jsonConvert.convert<
      UserTaskQueryRowsParams>(json['params']);
  if (params != null) {
    userTaskQueryRows.params = params;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    userTaskQueryRows.id = id;
  }
  final int? userId = jsonConvert.convert<int>(json['userId']);
  if (userId != null) {
    userTaskQueryRows.userId = userId;
  }
  final String? taskTitle = jsonConvert.convert<String>(json['taskTitle']);
  if (taskTitle != null) {
    userTaskQueryRows.taskTitle = taskTitle;
  }
  final String? taskTime = jsonConvert.convert<String>(json['taskTime']);
  if (taskTime != null) {
    userTaskQueryRows.taskTime = taskTime;
  }
  final String? taskDesc = jsonConvert.convert<String>(json['taskDesc']);
  if (taskDesc != null) {
    userTaskQueryRows.taskDesc = taskDesc;
  }
  final int? taskStatus = jsonConvert.convert<int>(json['taskStatus']);
  if (taskStatus != null) {
    userTaskQueryRows.taskStatus = taskStatus;
  }
  return userTaskQueryRows;
}

Map<String, dynamic> $UserTaskQueryRowsToJson(UserTaskQueryRows entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createTime'] = entity.createTime;
  data['params'] = entity.params?.toJson();
  data['id'] = entity.id;
  data['userId'] = entity.userId;
  data['taskTitle'] = entity.taskTitle;
  data['taskTime'] = entity.taskTime;
  data['taskDesc'] = entity.taskDesc;
  data['taskStatus'] = entity.taskStatus;
  return data;
}

extension UserTaskQueryRowsExtension on UserTaskQueryRows {
  UserTaskQueryRows copyWith({
    String? createTime,
    UserTaskQueryRowsParams? params,
    int? id,
    int? userId,
    String? taskTitle,
    String? taskTime,
    String? taskDesc,
    int? taskStatus,
  }) {
    return UserTaskQueryRows()
      ..createTime = createTime ?? this.createTime
      ..params = params ?? this.params
      ..id = id ?? this.id
      ..userId = userId ?? this.userId
      ..taskTitle = taskTitle ?? this.taskTitle
      ..taskTime = taskTime ?? this.taskTime
      ..taskDesc = taskDesc ?? this.taskDesc
      ..taskStatus = taskStatus ?? this.taskStatus;
  }
}

UserTaskQueryRowsParams $UserTaskQueryRowsParamsFromJson(
    Map<String, dynamic> json) {
  final UserTaskQueryRowsParams userTaskQueryRowsParams = UserTaskQueryRowsParams();
  return userTaskQueryRowsParams;
}

Map<String, dynamic> $UserTaskQueryRowsParamsToJson(
    UserTaskQueryRowsParams entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  return data;
}

extension UserTaskQueryRowsParamsExtension on UserTaskQueryRowsParams {
}